/*
 * @Description: 导出组件
 * @Author: Rfan
 * @Date: 2022-06-22 09:41:23
 * @LastEditTime: 2022-06-25 12:23:00
 */

import { Button, Dropdown, Menu, Space } from 'antd';
import FileOrder from './components/FileOrder';
import TransferOther from './components/TransferOther';
import { useBoxMgtContext } from '../../../contexts/BoxMgtContext';
import { DownOutlined } from '@ant-design/icons';

interface IChangeOrderOptProps {
  info: any;
}

const ChangeOrderOpt = (props: IChangeOrderOptProps) => {
  const { info } = props;

  const { selectItems } = useBoxMgtContext();

  const menu = (
    <Menu
      items={[
        {
          key: 'inner',
          label: <FileOrder info={info} selectItems={selectItems} />
        },
        {
          key: 'transfer',
          label: <TransferOther info={info} selectItems={selectItems} />
        }
      ]}
    />
  );

  return (
    <Dropdown overlay={menu} placement="bottom" trigger={['click']}>
      <Button>
        <Space>
          调序
          <DownOutlined />
        </Space>
      </Button>
    </Dropdown>
  );
};

export default ChangeOrderOpt;
